package Sales;

import java.util.ArrayList;

public class Invoice {

	
	private String receiptNum,customerName,recordedDate;
	private double balance;
	private ArrayList<Sale> sales;
	
	
	
	public Invoice(String InID,String Name,String date,double bal){
		receiptNum=InID;
		customerName=Name;
		recordedDate=date;
		balance=bal;
		sales=new ArrayList<Sale>();
	}
	
	public ArrayList<Sale> getSales() {
		return sales;
	}
	public void addSale(Sale S){
		sales.add(S);
	}
	public double getBalance(){
		return balance;
	}
	
	public void setBalance(double cost){ 
		balance=cost;
	}
	public void setSales(ArrayList<Sale> sales){
		sales = sales;
	}
	public String getReceiptNum() {
		return receiptNum;
	}
	public void setReceiptNum(String receiptNum) {
		receiptNum = receiptNum;
	}
	public String getCustomerName() {
		return customerName;
	}
	public void setCustomerName(String customerName) {
		customerName = customerName;
	}
	public String getRecordedDate() {
		return recordedDate;
	}
	public void setRecordedDate(String recordedDate) {
		recordedDate = recordedDate;
	}
	  public double getTotal(){
          double sum=0;
          for(int ctr=0;ctr<sales.size();ctr++)
              sum+=sales.get(ctr).getPrice();
          return sum;
      }
}
